<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateSchoolUserTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //
        /*
            id int 11 ID
            school_id int 11 学校ID
            college_id int 11 学院ID
            name string 255 姓名
            phone string 36 手机号
            username string 255 用户名
            password string 255 密码
            created_at timestamp 创建时间
            updated_at timestamp 更新时间
        */

        Schema::create('school_user', function (Blueprint $table) {
            $table->increments('id')->comment('辅导员id');
            $table->integer('school_id')->comment('学校id');
            $table->integer('college_id')->comment('学院id');
            $table->string('name', 255)->comment('姓名');
            $table->string('phone', 36)->comment('手机号');
            $table->string('username', 255)->comment('用户名');
            $table->string('password', 255)->comment('密码');
            $table->rememberToken();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
        Schema::dropIfExists('school_user');
    }
}
